DataSource for Entity Framework in WPF
C1.LiveLinq Namespace / IndexedQueryExtensions Class / ToIndexed Method / ToIndexed<T>(IObservableSource<T>) Method
The type of the elements in the collection.
An IObservableSource<T> collection to base an C1.LiveLinq.Indexing.IIndexedSource<T> on.

In This Topic
    ToIndexed<T>(IObservableSource<T>) Method
    In This Topic
    Creates an C1.LiveLinq.Indexing.IIndexedSource<T> based on the specified IObservableSource<T> collection.
    Syntax
    'Declaration
     
    Public Overloads Shared Function ToIndexed(Of T)( _
       ByVal source As IObservableSource(Of T) _
    ) As IIndexedSource(Of T)
    public static IIndexedSource<T> ToIndexed<T>( 
       IObservableSource<T> source
    )

    Parameters

    source
    An IObservableSource<T> collection to base an C1.LiveLinq.Indexing.IIndexedSource<T> on.

    Type Parameters

    T
    The type of the elements in the collection.

    Return Value

    An C1.LiveLinq.Indexing.IIndexedSource<T> that contains the same elements as the IObservableSource<T> collection and enables indexing of that collection.
    Remarks

    Use this method to index and query your collection if that collection is your own custom implementation of the IObservableSource<T> interface.

    Elements of the source collection aren't duplicated or copied to a new collection. This method just wraps the original collection in an C1.LiveLinq.Indexing.IIndexedSource<T>, enabling its indexing by using the change notification mechanism of IObservableSource<T>.

    Note: Indexes created on the resulting C1.LiveLinq.Indexing.IIndexedSource<T> are owned by it and not by the original collection. Every ToIndexed() call creates a separate object that has its own separate indexes. Avoid calling ToIndexed() repeatedly for the same collection because it can increase the cost of maintaining indexes.

    See Also